package 工厂模式

import "fmt"

// 艺术家 要会唱跳rap
type YiShuJia interface {
	sing()
	dance()
	rap()
}

func ChuangZaoYiShuJia(name string) YiShuJia {
	switch name {
	case "孙笑川":
		return &MataChuan{}
	case "刘波":
		return &YaoShui{}
	}
	return nil
}

type MataChuan struct {
}

func (m *MataChuan) sing() {
	fmt.Println("Mata sing!")
}
func (m *MataChuan) dance() {
	fmt.Println("Mata dance!")
}
func (m *MataChuan) rap() {
	fmt.Println("Mata rap!")
}

type YaoShui struct {
}

func (m *YaoShui) sing() {
	fmt.Println("YaoShui sing!")
}
func (m *YaoShui) dance() {
	fmt.Println("YaoShui dance!")
}
func (m *YaoShui) rap() {
	fmt.Println("YaoShui rap!")
}

